<template>
	<view>
		<u-count-down :time="time" format="mm分ss秒" autoStart @change="onChange">
			<view class="time">
				<text class="time__item">{{ timeData.minutes }}&nbsp;分</text>
				<text class="time__item">{{ timeData.seconds }}&nbsp;秒</text>
			</view>
		</u-count-down>
	</view>
</template>

<script>
	export default {
		name: "hs-countdown",
		props: {
			time: {
				type: Number,
				default: 0,
			},
		},
		data() {
			return {
				timeData: {}
			};
		},
		methods: {
			onChange(e) {
				this.timeData = e
			}
		}

	}
</script>

<style>

</style>